﻿<UserControl x:Class="My.CodePlex.TFSExplorer.ShelveSetControl"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:local="clr-namespace:My.CodePlex.TFSExplorer">
    <Grid>
        <Grid.RowDefinitions>
            <RowDefinition Height="35" />
            <RowDefinition />
        </Grid.RowDefinitions>

        <StackPanel Orientation="Horizontal">
            <Button Height="25" Width="90" Margin="0,0,5,0" Click="UnShelveClick">
                <Button.Content>
                    <StackPanel Orientation="Horizontal">
                        <Image Height="16" Width="16" Margin="0,0,5,0" Source="pack://application:,,,/My.CodePlex.TFSExplorer;component/Images/Unshelve.png"/>
                        <TextBlock Text="UnShelve" />
                    </StackPanel>
                </Button.Content>
            </Button>
            <Button Height="25" Width="90" Margin="0,0,5,0" Click="DeleteClick">
                <Button.Content>
                    <StackPanel Orientation="Horizontal">
                        <Image Height="16" Width="16" Margin="0,0,5,0" Source="pack://application:,,,/My.CodePlex.TFSExplorer;component/Images/Delete.png"/>
                        <TextBlock Text="Delete" />
                    </StackPanel>
                </Button.Content>
            </Button>
            <Button Height="25" Width="90" Margin="0,0,5,0" Click="RefreshClick">
                <Button.Content>
                    <StackPanel Orientation="Horizontal">
                        <Image Height="16" Width="16" Margin="0,0,5,0" Source="pack://application:,,,/My.CodePlex.TFSExplorer;component/Images/Refresh.png"/>
                        <TextBlock Text="Refresh" />
                    </StackPanel>
                </Button.Content>
            </Button>
        </StackPanel>
        
        <Grid Grid.Row="1">
            <Grid.ColumnDefinitions>
                <ColumnDefinition />
                <ColumnDefinition />
            </Grid.ColumnDefinitions>
                      
            <ListView Name="ShelveSetView"
                      local:ListViewSorter.CustomListViewSorter="My.CodePlex.TFSExplorer.ShelvesetItemComparer">
                <ListView.View>
                    <GridView>
                        <GridViewColumn Width="Auto" Header="Shelveset name" DisplayMemberBinding="{Binding Name}" />
                        <GridViewColumn Width="Auto" Header="Date" DisplayMemberBinding="{Binding CreationDate}"  />
                        <GridViewColumn Width="Auto" Header="Comment" DisplayMemberBinding="{Binding Comment}"  />
                    </GridView>
                </ListView.View>
            </ListView>
            <GridSplitter Width="3" />
            
            <ListView Name="ShelveSetDetailView" Grid.Column="1"
                      local:ListViewSorter.CustomListViewSorter="My.CodePlex.TFSExplorer.PendingChangesItemComparer">
                <ListView.View>
                    <GridView>
                        <GridViewColumn Width="Auto" Header="File Name">
                            <GridViewColumn.CellTemplate>
                                <DataTemplate>
                                    <Grid Margin="6,0,6,0" >
                                        <Grid.ColumnDefinitions>
                                            <ColumnDefinition Width ="20" />
                                            <ColumnDefinition Width ="*" />
                                        </Grid.ColumnDefinitions>
                                        <Image VerticalAlignment ="Center" Width="16" Height="16" Stretch="None" Source="{Binding ImgSource}" />
                                        <TextBlock Text="{Binding FileName}" Grid.Column="1" TextTrimming="CharacterEllipsis" VerticalAlignment ="Center" />
                                    </Grid>
                                </DataTemplate>
                            </GridViewColumn.CellTemplate>
                        </GridViewColumn>
                        <GridViewColumn Width="Auto" Header="Date" DisplayMemberBinding="{Binding ChangeTypeName}"  />
                        <GridViewColumn Width="Auto" Header="Folder" DisplayMemberBinding="{Binding ServerItem}"  />
                    </GridView>
                </ListView.View>
            </ListView>
        </Grid>
    </Grid>
</UserControl>
